home *** CD-ROM | disk | FTP | other *** search
/ Teach Your Children: Road Construction Ahead / Teach Your Children: Road Construction Ahead.iso / pc / rca / road.dxr / 00029_RolloverSound Class.ls < prev    next >
Encoding:
Text File  |  1996-07-17  |  730 b   |  36 lines

  1. property channel, state, soundName
  2. global gRollAnimButton, gLoopButton
  3.  
  4. on birth me, whichChan, whichSound
  5.   set state to #idle
  6.   set channel to whichChan
  7.   set soundName to whichSound
  8.   return me
  9. end
  10.  
  11. on update me
  12.   doRollover(me)
  13. end
  14.  
  15. on doRollover me
  16.   if state = #idle then
  17.     if rollOver(channel) then
  18.       if not soundBusy(1) and not objectp(gRollAnimButton) and not objectp(gLoopButton) then
  19.         puppetSound(soundName)
  20.         set state to #soundOn
  21.       end if
  22.     end if
  23.   else
  24.     if state = #soundOn then
  25.       if not soundBusy(1) then
  26.         puppetSound(0)
  27.         set state to #soundDone
  28.       end if
  29.     else
  30.       if not rollOver(channel) then
  31.         set state to #idle
  32.       end if
  33.     end if
  34.   end if
  35. end
  36.